var pageii = null;
var grid = null;
$(function() {

	grid = lyGrid({
		pagId : 'paging',
		l_column : [ {
			colkey : "id",
			name : "序号"
		},{
			colkey : "tranDate",
			name : "日期",
			renderData : function(rowindex,data, rowdata, column) {
					return new Date(data).format("yyyy-MM-dd hh:mm:ss");
			}
		}, {
			colkey : "department",
			name : "申请部门"
		},{
			colkey : "suppName",
			name : "实际供应商"
		},{
			colkey : "purchaseNo",
			name : "采购单号"
		},{
			colkey : "materialNo",
			name : "物料编码"
		},{
			colkey : "productName",
			name : "名称"
		},{
			colkey : "model",
			name : "规格型号"
		},{
			colkey : "unit",
			name : "单位"
		},{
			colkey : "pcount",
			name : "数量"
		},{
			colkey : "brand",
			name : "类型"
		},{
			colkey : "unitPrice",
			name : "单价"
		},{
			colkey : "total",
			name : "总价"
		},{
			colkey : "apply",
			name : "请求状态"
		},{
			colkey : "quality",
			name : "品质"
		},{
			colkey : "purchaseaStartDate",
			name : "发货日期",
			renderData : function(rowindex,data, rowdata, column) {
					return new Date(data).format("yyyy-MM-dd hh:mm:ss");
			}
		},{
			colkey : "purchaseaEndDate",
			name : "收货日期",
			renderData : function(rowindex,data, rowdata, column) {
					return new Date(data).format("yyyy-MM-dd hh:mm:ss");
			}
		},{
			colkey : "remark",
			name : "备注"
		}],
		jsonUrl : rootPath + '/purcha/buy_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});
	
	$("#search").click("click", function() {// 绑定查询按扭
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
	
});


